package com.tdkj.model.shop;

import java.math.BigDecimal;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * OrderContents entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shop_order_item")
public class BeanOrderItem extends BaseEntity {

	// Fields
	private BeanOrder order;
	private BeanGood good;
	private BeanGoodSnapshot snapshot;
	private Integer quantity;
	//0,1
	private Integer state;
	
	//物流方式，0 1 2
	private Integer logisticsApproach;
	private BigDecimal logisticsPrice;
	
	private Boolean isBuyerEvaluated;
	private Boolean isSellerEvaluated;
	
	private Boolean isFromAuction;
	
	private BeanEvaluate buyerEvaluate;
	private BeanEvaluate sellerEvaluate;

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	@OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="snapshot_id")
	public BeanGoodSnapshot getSnapshot() {
		return snapshot;
	}

	public void setSnapshot(BeanGoodSnapshot snapshot) {
		this.snapshot = snapshot;
	}

	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="order_id")
	public BeanOrder getOrder() {
		return order;
	}

	public void setOrder(BeanOrder order) {
		this.order = order;
	}

	@ManyToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinColumn(name="good_id")
	public BeanGood getGood() {
		return good;
	}

	public void setGood(BeanGood good) {
		this.good = good;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Boolean getIsBuyerEvaluated() {
		return isBuyerEvaluated;
	}

	public void setIsBuyerEvaluated(Boolean isBuyerEvaluated) {
		this.isBuyerEvaluated = isBuyerEvaluated;
	}

	public Boolean getIsSellerEvaluated() {
		return isSellerEvaluated;
	}

	public void setIsSellerEvaluated(Boolean isSellerEvaluated) {
		this.isSellerEvaluated = isSellerEvaluated;
	}

	public Integer getLogisticsApproach() {
		return logisticsApproach;
	}

	public void setLogisticsApproach(Integer logisticsApproach) {
		this.logisticsApproach = logisticsApproach;
	}

	public BigDecimal getLogisticsPrice() {
		return logisticsPrice;
	}

	public void setLogisticsPrice(BigDecimal logisticsPrice) {
		this.logisticsPrice = logisticsPrice;
	}

	public Boolean getIsFromAuction() {
		return isFromAuction;
	}

	public void setIsFromAuction(Boolean isFromAuction) {
		this.isFromAuction = isFromAuction;
	}

	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinColumn(name="buyer_evaluate_id")
	public BeanEvaluate getBuyerEvaluate() {
		return buyerEvaluate;
	}

	public void setBuyerEvaluate(BeanEvaluate buyerEvaluate) {
		this.buyerEvaluate = buyerEvaluate;
	}

	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH})
	@JoinColumn(name="seller_evaluate_id")
	public BeanEvaluate getSellerEvaluate() {
		return sellerEvaluate;
	}

	public void setSellerEvaluate(BeanEvaluate sellerEvaluate) {
		this.sellerEvaluate = sellerEvaluate;
	}

	
}